#ifndef __RENDERER__H
#define __RENDERER__H

#ifdef _WIN_32
#  include <windows.h>
#endif
#include <windows.h>
#include <GL/gl.h>
#include <GL/glu.h>

#include "Color.h"
#include "TriMesh.h"
#include "Polyline.h"

class Renderer
{
public:
	Renderer( int width, int height );
	virtual ~Renderer();

	void get_driver_information();

	virtual void set_background_color( const Color &color );
	virtual void clear_back_buffer();
	virtual void display_back_buffer();
	virtual void clear_zbuffer();
	virtual void clear_buffers();

	virtual void draw( const TriMesh& mesh );
	virtual void draw( const Polyline& poly );

	void create_renderer();

protected:
	virtual void init_state();
	virtual void set_alpha_state( AlphaState* state );
	virtual void set_dither_state( DitherState* state );
	virtual void set_fog_state( FogState* state );
	virtual void set_light_state( LightState* state );
	virtual void set_material_state( MaterialState* state );
	virtual void set_shade_state( ShadeState* state );
	virtual void set_texture_state( TextureState* state );
	virtual void set_vertex_color_state( VertexColorState* state );
	virtual void set_wireframe_state( WireframeState* state );
	virtual void set_zbuffer_state( ZBufferState* state );

	// Windows parameters
	HWND hWnd;
	HDC hDC;
	HGLRC hRC;
};	

#endif





